Optimal. Leaf size=244 \[ \frac{2^{n+\frac{1}{2}} (A (m+n+1)+C (m-n)) \tan (c+d x) (\sec (c+d x)+1)^{-n-\frac{1}{2}} (a \sec (c+d x)+a)^n F_1\left (\frac{1}{2};1-m,\frac{1}{2}-n;\frac{3}{2};1-\sec (c+d x),\frac{1}{2} (1-\sec (c+d x))\right )}{d (m+n+1)}+\frac{C 2^{n+\frac{3}{2}} n \tan (c+d x) (\sec (c+d x)+1)^{-n-\frac{1}{2}} (a \sec (c+d x)+a)^n F_1\left (\frac{1}{2};1-m,-n-\frac{1}{2};\frac{3}{2};1-\sec (c+d x),\frac{1}{2} (1-\sec (c+d x))\right )}{d (m+n+1)}+\frac{C \sin (c+d x) \sec ^{m+1}(c+d x) (a \sec (c+d x)+a)^n}{d (m+n+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.533392, antiderivative size = 244, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 5, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.152, Rules used = {4089, 4023, 3828, 3825, 133} \[ \frac{2^{n+\frac{1}{2}} (A (m+n+1)+C (m-n)) \tan (c+d x) (\sec (c+d x)+1)^{-n-\frac{1}{2}} (a \sec (c+d x)+a)^n F_1\left (\frac{1}{2};1-m,\frac{1}{2}-n;\frac{3}{2};1-\sec (c+d x),\frac{1}{2} (1-\sec (c+d x))\right )}{d (m+n+1)}+\frac{C 2^{n+\frac{3}{2}} n \tan (c+d x) (\sec (c+d x)+1)^{-n-\frac{1}{2}} (a \sec (c+d x)+a)^n F_1\left (\frac{1}{2};1-m,-n-\frac{1}{2};\frac{3}{2};1-\sec (c+d x),\frac{1}{2} (1-\sec (c+d x))\right )}{d (m+n+1)}+\frac{C \sin (c+d x) \sec ^{m+1}(c+d x) (a \sec (c+d x)+a)^n}{d (m+n+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4089
Rule 4023
Rule 3828
Rule 3825
Rule 133
Rubi steps
\begin{align*} \int \sec ^m(c+d x) (a+a \sec (c+d x))^n \left (A+C \sec ^2(c+d x)\right ) \, dx &=\frac{C \sec ^{1+m}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+m+n)}+\frac{\int \sec ^m(c+d x) (a+a \sec (c+d x))^n (a (C m+A (1+m+n))+a C n \sec (c+d x)) \, dx}{a (1+m+n)}\\ &=\frac{C \sec ^{1+m}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+m+n)}+\frac{(C n) \int \sec ^m(c+d x) (a+a \sec (c+d x))^{1+n} \, dx}{a (1+m+n)}+\left (A+\frac{C (m-n)}{1+m+n}\right ) \int \sec ^m(c+d x) (a+a \sec (c+d x))^n \, dx\\ &=\frac{C \sec ^{1+m}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+m+n)}+\frac{\left (C n (1+\sec (c+d x))^{-n} (a+a \sec (c+d x))^n\right ) \int \sec ^m(c+d x) (1+\sec (c+d x))^{1+n} \, dx}{1+m+n}+\left (\left (A+\frac{C (m-n)}{1+m+n}\right ) (1+\sec (c+d x))^{-n} (a+a \sec (c+d x))^n\right ) \int \sec ^m(c+d x) (1+\sec (c+d x))^n \, dx\\ &=\frac{C \sec ^{1+m}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+m+n)}+\frac{\left (C n (1+\sec (c+d x))^{-\frac{1}{2}-n} (a+a \sec (c+d x))^n \tan (c+d x)\right ) \operatorname{Subst}\left (\int \frac{(1-x)^{-1+m} (2-x)^{\frac{1}{2}+n}}{\sqrt{x}} \, dx,x,1-\sec (c+d x)\right )}{d (1+m+n) \sqrt{1-\sec (c+d x)}}+\frac{\left (\left (A+\frac{C (m-n)}{1+m+n}\right ) (1+\sec (c+d x))^{-\frac{1}{2}-n} (a+a \sec (c+d x))^n \tan (c+d x)\right ) \operatorname{Subst}\left (\int \frac{(1-x)^{-1+m} (2-x)^{-\frac{1}{2}+n}}{\sqrt{x}} \, dx,x,1-\sec (c+d x)\right )}{d \sqrt{1-\sec (c+d x)}}\\ &=\frac{C \sec ^{1+m}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+m+n)}+\frac{2^{\frac{3}{2}+n} C n F_1\left (\frac{1}{2};1-m,-\frac{1}{2}-n;\frac{3}{2};1-\sec (c+d x),\frac{1}{2} (1-\sec (c+d x))\right ) (1+\sec (c+d x))^{-\frac{1}{2}-n} (a+a \sec (c+d x))^n \tan (c+d x)}{d (1+m+n)}+\frac{2^{\frac{1}{2}+n} \left (A+\frac{C (m-n)}{1+m+n}\right ) F_1\left (\frac{1}{2};1-m,\frac{1}{2}-n;\frac{3}{2};1-\sec (c+d x),\frac{1}{2} (1-\sec (c+d x))\right ) (1+\sec (c+d x))^{-\frac{1}{2}-n} (a+a \sec (c+d x))^n \tan (c+d x)}{d}\\ \end{align*}
Mathematica [F] time = 18.1964, size = 0, normalized size = 0. \[ \int \sec ^m(c+d x) (a+a \sec (c+d x))^n \left (A+C \sec ^2(c+d x)\right ) \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 1.099, size = 0, normalized size = 0. \begin{align*} \int \left ( \sec \left ( dx+c \right ) \right ) ^{m} \left ( a+a\sec \left ( dx+c \right ) \right ) ^{n} \left ( A+C \left ( \sec \left ( dx+c \right ) \right ) ^{2} \right ) \, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (C \sec \left (d x + c\right )^{2} + A\right )}{\left (a \sec \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{m}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (C \sec \left (d x + c\right )^{2} + A\right )}{\left (a \sec \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{m}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (C \sec \left (d x + c\right )^{2} + A\right )}{\left (a \sec \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{m}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]